/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface ShopSalesPackages extends BasicModel<ShopSalesPackages> {
  parent?: string; // 主表ID
  invType?: string; // 物料类型
  invCode?: string; // 存货编码
  bgift?: string; // 是否赠品
  iqty?: number; // 数量
  iprice?: number; // 单价
  isum?: number; // 金额
  groupType?: string; // 选择类型
  groupId?: string; // 分组标志
  groupName?: string; // 分组名称
  groupQty?: number; // 选择数量
}

export const shopSalesPackagesList = (params?: ShopSalesPackages | any) =>
  defHttp.get<ShopSalesPackages>({ url: adminPath + '/shop/sales/shopSalesPackages/list', params });

// export const shopSalesPackagesListData = (params?: ShopSalesPackages | any) =>
//   defHttp.post<Page<ShopSalesPackages>>({ url: adminPath + '/shop/sales/shopSalesPackages/listData', params });
export const shopSalesPackagesListData = (params?: ShopSalesPackages | any) =>
  defHttp.post<Page<ShopSalesPackages>>({ url: adminPath + '/shop/sales/shopSalesPackages/listDataNoPage', params });

export const shopSalesPackagesForm = (params?: ShopSalesPackages | any) =>
  defHttp.get<ShopSalesPackages>({ url: adminPath + '/shop/sales/shopSalesPackages/form', params });

export const shopSalesPackagesSave = (params?: any, data?: ShopSalesPackages | any) =>
  defHttp.postJson<ShopSalesPackages>({ url: adminPath + '/shop/sales/shopSalesPackages/save', params, data });

export const shopSalesPackagesDelete = (params?: ShopSalesPackages | any) =>
  defHttp.get<ShopSalesPackages>({ url: adminPath + '/shop/sales/shopSalesPackages/delete', params });

export const shopSalesPackagesBatchDelete = (params?: ShopSalesPackages | any) =>
  defHttp.get<ShopSalesPackages>({ url: adminPath + '/shop/sales/shopSalesPackages/batchDelete', params });
  

  export const shopSalesPackagesSaveGroup = (params?: any, data?: ShopSalesPackages | any) =>
  defHttp.postJson<ShopSalesPackages>({ url: adminPath + '/shop/sales/shopSalesPackages/saveGroup', params, data });
 
  export const shopSalesPackagesCancelGroup = (params?: ShopSalesPackages | any) =>
  defHttp.post<ShopSalesPackages>({ url: adminPath + '/shop/sales/shopSalesPackages/cancelGroup', params });
  